Skip to content

Replace EPS/PS to SVG via postsvg (pure Ruby) - #68

Merged
ronaldtse merged 1 commit into
mainfrom
wire-postsvg-eps-ps-to-svg
Jul 27, 2026
Merged

Replace EPS/PS to SVG via postsvg (pure Ruby)#68
ronaldtse merged 1 commit into
mainfrom
wire-postsvg-eps-ps-to-svg

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Replaces the Ghostscript + Inkscape two-step for Eps#to_svg and Ps#to_svg with a direct call to the pure-Ruby postsvg gem. Reads %%BoundingBox from the DSC header for the SVG viewBox.

Closes #67.

Changes

  • vectory.gemspec: add postsvg ~> 0.1
  • lib/vectory/eps.rb, lib/vectory/ps.rb: require "postsvg"; to_svg = Svg.from_content(Postsvg.convert(content))
  • spec/vectory/eps_spec.rb: drop two stale error-propagation tests for to_svg (they assumed the Ghostscript+Inkscape path)
  • docs/features/{conversion,index}.adoc, docs/getting-started/core-concepts.adoc: reflect the new direct EPS/PS → SVG path

Test plan

  • bundle exec rspec — 191/191 pass (was 193; 2 stale tests removed)

Caveats

postsvg 0.1.x has known limitations upstream (no text/font rendering, no image embedding, no gradients/patterns, no CMYK, no PS Level 2/3 advanced ops). EPS/PS files using those features will silently degrade when converted to SVG. This is acceptable for vectory's test fixtures (verified by the smoke test) but real-world users with complex EPS files may see regressions vs the old Ghostscript + Inkscape path.

Follow-ups

The full external-tool elimination is sequenced as 5 PRs (see issue thread on #67). This is PR 1. Remaining work:

  • PR 2: SVG → EPS/PS via postsvg (blocked on postsvg 0.2.0 release for the to_eps/to_ps API)
  • PR 3: Emf dimensions via emf header (drop Inkscape fallback)
  • PR 4: Drop PDF class entirely
  • PR 5: Delete InkscapeWrapper + GhostscriptWrapper + Ukiryu + related errors

EPS-to-SVG and PS-to-SVG no longer shell out to Ghostscript + Inkscape.
Both call Postsvg.convert directly. The Ghostscript + Inkscape
two-step remains in place for EPS/PS -> PDF and EPS/PS -> PS/EMF (via
PDF intermediate) -- those will move in follow-up PRs.

- vectory.gemspec: add postsvg ~> 0.1
- lib/vectory/eps.rb, lib/vectory/ps.rb: require "postsvg"; to_svg =
  Svg.from_content(Postsvg.convert(content))
- spec/vectory/eps_spec.rb: drop two stale error-propagation tests for
  to_svg (they assumed the Ghostscript+Inkscape path)
- docs/features/{conversion,index}.adoc, docs/getting-started/core-concepts.adoc:
  reflect new direct EPS/PS -> SVG path

Closes #67
@github-actions

Copy link
Copy Markdown

🔗 Link Check Failed


Please fix the broken links and push a new commit.

@ronaldtse
ronaldtse merged commit b5fdaf8 into main Jul 27, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Inkscape+Ghostscript EPS/PS→SVG with postsvg

1 participant